package cc.comac.mom.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipPatrolCheckPlanService;
import cc.comac.mom.bean.EquipPatrolCheckPlan;
import cc.comac.mom.bean.EquipPatrolCheckPlanBean;
import cc.comac.mom.entity.EquipPatrolCheckPlanEntity;
import cc.comac.mom.util.ResultBean;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "/EquipPatrolCheckPlan")
public class EquipPatrolCheckPlanController {

	@Autowired
	private EquipPatrolCheckPlanService equipPatrolCheckPlanService;
	
	@ApiOperation("新增巡检计划")
	@RequestMapping("/insert")
	public ResultBean insert(@RequestBody EquipPatrolCheckPlan obj) {
		return equipPatrolCheckPlanService.insert(obj);
	}

	@ApiOperation("删除巡检计划")
	@RequestMapping("/delete")
	public ResultBean insert(@RequestBody List<EquipPatrolCheckPlan> obj) {
		return equipPatrolCheckPlanService.delete(obj);
	}


	@ApiOperation("修改巡检计划")
	@RequestMapping("/update")
	public ResultBean update(@RequestBody EquipPatrolCheckPlan obj) {
		return equipPatrolCheckPlanService.update(obj);
	}

	@ApiOperation("巡检计划下发")
	@RequestMapping("/planIssue")
	public ResultBean planIssue(@RequestBody List<EquipPatrolCheckPlanEntity> list) {
		return equipPatrolCheckPlanService.planIssue(list);
	}

	@ApiOperation("查询巡检计划")
	@RequestMapping("/selectByFields")
	public ResultBean selectByFields(@RequestBody EquipPatrolCheckPlanBean obj) {
		return equipPatrolCheckPlanService.selectByFields(obj);
	}
}
